package com.zzx.project.service.impl;

import com.zzx.project.dao.ArticleDao;
import com.zzx.project.entity.Article;
import com.zzx.project.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    ArticleDao articleDao;

    @Override
    public int addArticle(Article article, String uid) {
        return articleDao.addArticle(article, uid);
    }

    @Override
    public Article getNewArticleByUname(String userName) {
        return articleDao.getNewArticleByUname(userName);
    }

    @Override
    public List<Article> getLevelThree() {
        return articleDao.getLevelThree();
    }

    @Override
    public List<Article> getLevelOne() {
        return articleDao.getLevelOne();
    }

    @Override
    public int getLevelOneCount() {
        return articleDao.getLevelOneCount();
    }

    @Override
    public int getAllArticleCount() {
        return articleDao.getAllArticleCount();
    }

    @Override
    public List<Article> getArticleBySearch(String content) {
        return articleDao.getArticleBySearch(content);
    }

    @Override
    public List<Article> getHotArticle() {
        return articleDao.getHotArticle();
    }

    @Override
    public List<Article> getRecommend() {
        return articleDao.getRecommend();
    }

    @Override
    public List<Article> getRandomArticle() {
        return articleDao.getRandomArticle();
    }

    @Override
    public List<Article> getArticleByColumn(int column) {
        return articleDao.getArticleByColumn(column);
    }

    @Override
    public Article getArticleById(String aidString) {
        return articleDao.getArticleById(Integer.parseInt(aidString));
    }

    @Override
    public List<Article> getArticleForPage(int pageNo) {
        return articleDao.getArticleForPage(pageNo);
    }

    @Override
    public List<Article> getArticlesByTagName(String tname) {
        return articleDao.getArticlesByTagName(tname);
    }

    @Override
    public void addAudience(String uid, int aid) {
        articleDao.addAudience(uid, aid);
    }

    @Override
    public int addSupportById(String uids, int aid) {
        return articleDao.addSupportById(uids, aid);
    }
}
